package tech.wetech.admin3.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import tech.wetech.admin3.infra.AooTokenInterceptor;

@Configuration
public class AooWebConfig implements WebMvcConfigurer {
  @Autowired
  private AooTokenInterceptor aooTokenInterceptor;

  @Override
  public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(aooTokenInterceptor)
      .addPathPatterns("/**")  // 指定拦截的URL
      .excludePathPatterns(
        "/aoo/aoologin",
        "/aoo/aoologinph",
        "/aoo/register",
        "/phone/sendcode",
        "/wx_auth/login",
        "/scan/getaddress",
        "/scan/wxLogin",
        "/scan/aliLogin",
        "/scan/getaddress_ali",
        "/email/getcode",
        "/aoo/updateInfo",
        "/aoo/user/delete/",
        "/email/verifyCode",
        "/alipay/easy/notify",
        "/wxpay/native/notify",
        "/Digital/admin/reset/status-virtualman",
        "/Digital/admin/update/paid",
        "/mhv/admin/getall_mhv",
        "/did/admin/deletedid",
        "/did/admin/get-dids"
      );  // 指定不拦截的URL
  }
}
